<template>
	<view class="grid">
		<u-grid :col="3" @click="showMore">
			<u-grid-item
				v-for="(p, i) in list"
				:key="i"
				:index="i"
			>
				<view class="panel">
					<text :class="{ iconfont: true, rotateY: p.rotateY }">{{p.icon}}</text>
					<text>{{p.t1}}</text>
					<text>{{p.t2}}</text>
				</view>
			</u-grid-item>
		</u-grid>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{ icon: '\ue6e0', t1: '左眼裸眼视力', t2: '5.0', rotateY: true },
					{ icon: '\ue6e0', t1: '右眼裸眼视力', t2: '5.0' },
					{ icon: '\ue670', t1: '左眼屈光度', t2: '≥-1.50D' },
					{ icon: '\ue670', t1: '右眼屈光度', t2: '≥-1.50D', rotateY: true },
					{ icon: '\ue633', t1: '左眼散光', t2: '>1.50D' },
					{ icon: '\ue633', t1: '右眼散光', t2: '>1.50D', rotateY: true },
					{ icon: '\ue66a', t1: '瞳距', t2: 'PD:61' }
				]
			};
		},
		onLoad() {

		},
		methods: {
			showMore(i) {
				uni.navigateTo({
					url: `/pages/articleDetail/articleDetail?t1=${this.list[i].t1}`,
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.grid {
		color: #a7abb1;
		font-size: $uni-font-size-sm;
		margin-bottom: $uni-spacing-col-base;
		.panel {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.iconfont {
				margin-bottom: 10rpx;
				font-size: 50rpx;
			}
		}
	}
	.rotateY {
		transform: rotateY(180deg);
	}
</style>
